package algotrader;

import java.util.List;

import algotrader.book.Book;
import algotrader.book.BookLine;
import algotrader.book.BookManagerObserver;

public class FakeBookManagerObserver implements BookManagerObserver {
	private Book book;
	@Override
	public boolean hasBook(String string) {
		if (book == null) return false;
		if(book.getAtivo().equals(string)) return true;
		return false;
	}

	@Override
	public void receiveBook(Book book) {
		this.book = book;
	}

	@Override
	public Book getBook() {
		return book;
	}

	@Override
	public void receiveBookLine(BookLine bookLine) {
		book.addBookLine(bookLine);
	}

	@Override
	public void removeBookLine(BookLine bookLine) {
		this.book.removeBookLine(bookLine);
	}

	@Override
	public void receiveBookLines(List<BookLine> bls) {
		this.book.addBookLines(bls);
	}

}
